<template>
  <div>
    <el-tabs type="border-card" @tab-click="tabsEvent">
      <empInfo :pId="pId" />
      <el-tab-pane label="受训运动员"><keep-alive><playerCoachMap v-if="index == 0" :pId="pId" :newPerson="this.$route.params.newPerson" /></keep-alive></el-tab-pane>
      <el-tab-pane label="基本信息"><keep-alive><empDetail v-if="index == 1" :pId="pId" /></keep-alive></el-tab-pane>
      <el-tab-pane label="运动项目经历"><keep-alive><coachSportMap v-if="index == 2" :pId="pId" /></keep-alive></el-tab-pane>
      <el-tab-pane label="入职信息"><keep-alive><empSchool v-if="index == 3" :pId="pId" /></keep-alive></el-tab-pane>
      <el-tab-pane label="家庭成员"><keep-alive><empFamily v-if="index == 4" :pId="pId" /></keep-alive></el-tab-pane>
      <el-tab-pane label="外语水平"><keep-alive><empLanguage v-if="index == 5" :pId="pId" /></keep-alive></el-tab-pane>
      <el-tab-pane label="任职经历"><keep-alive><empOfficeHistory v-if="index == 6" :pId="pId" /></keep-alive></el-tab-pane>
      <el-tab-pane label="教育经历"><keep-alive><empEducation v-if="index == 7" :pId="pId" /></keep-alive></el-tab-pane>
      <el-tab-pane label="学术论文著作"><keep-alive><empPaper v-if="index == 8" :pId="pId" /></keep-alive></el-tab-pane>
      <el-tab-pane label="运动等级"><keep-alive><empProfessionLevel v-if="index == 9" :pId="pId" /></keep-alive></el-tab-pane>
      <el-tab-pane label="裁判等级"><keep-alive><empReferee v-if="index == 10" :pId="pId" /></keep-alive></el-tab-pane>
      <el-tab-pane label="奖惩情况"><keep-alive><empRewardPunishment v-if="index == 11" :pId="pId" /></keep-alive></el-tab-pane>
      <el-tab-pane label="职称等级"><keep-alive><empProfessionalQulification v-if="index == 12" :pId="pId" /></keep-alive></el-tab-pane>
      <el-tab-pane label="进修培训"><keep-alive><empFurtherEducation v-if="index == 13" :pId="pId" /></keep-alive></el-tab-pane>
      <el-tab-pane label="重点运动员记录"><keep-alive><empImpPlayerRecord v-if="index == 14" :pId="pId" /></keep-alive></el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
  import empInfo from '@/components/person/empDetail/empInfo.vue'
  import playerCoachMap from '@/components/person/empDetail/playerCoachMap.vue'
  import empDetail from '@/components/person/empDetail/empDetail.vue'
  import coachSportMap from '@/components/person/empDetail/coachSportMap.vue'
  import empSchool from '@/components/person/empDetail/empSchool.vue'
  import empFamily from '@/components/person/empDetail/empFamily.vue'
  import empLanguage from '@/components/person/empDetail/empLanguage.vue'
  import empOfficeHistory from '@/components/person/empDetail/empOfficeHistory.vue'
  import empEducation from '@/components/person/empDetail/empEducation.vue'
  import empPaper from '@/components/person/empDetail/empPaper.vue'
  import empProfessionLevel from '@/components/person/empDetail/empProfessionLevel.vue'
  import empReferee from '@/components/person/empDetail/empReferee.vue'
  import empRewardPunishment from '@/components/person/empDetail/empRewardPunishment.vue'
  import empProfessionalQulification from '@/components/person/empDetail/empProfessionalQulification.vue'
  import empFurtherEducation from '@/components/person/empDetail/empFurtherEducation.vue'
  import empImpPlayerRecord from '@/components/person/empDetail/empImpPlayerRecord.vue'
  export default {
    components: {
      empInfo,
      playerCoachMap,
      empDetail,
      coachSportMap,
      empSchool,
      empFamily,
      empLanguage,
      empOfficeHistory,
      empEducation,
      empPaper,
      empProfessionLevel,
      empReferee,
      empRewardPunishment,
      empProfessionalQulification,
      empFurtherEducation,
      empImpPlayerRecord,
    },
    data() {
      return {
        pId: '',
        index: 0,
      }
    },
    created() {
      this.pId = window.sessionStorage.getItem('pId')
    },
    methods:{
      tabsEvent(e){
        this.index = e.index
      },
    },
    destroyed() {
      window.sessionStorage.removeItem('pId')
    },
  }
</script>

<style lang="scss" scoped>

</style>
